﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using yunbo.Model.BIP;
using yunbo.Repositorys.FPMRepositorys;

namespace yunbo.Controllers.BIPControllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class BD_CPTPController : ControllerBase
    {
        BD_CPTPRepository bD_CPTPRepository = new BD_CPTPRepository();
        [HttpGet("Getcptpe")]
        public IActionResult Getcptpe(string code)
        {
            var quans = bD_CPTPRepository.Getcptpe(code);
            return Ok(quans);
        }

        [HttpPost("AddCPTP")]
        public IActionResult AddCPTP(BD_CPTP cPTP)
        {
            var quans = bD_CPTPRepository.AddCPTP(cPTP);
            return Ok(quans);
        }

        [HttpPut("UpdateCPTP")]
        public IActionResult UpdateCPTP(BD_CPTP cPTP)
        {
            var quans = bD_CPTPRepository.UpdateCPTP(cPTP);
            return Ok(quans);
        }

        [HttpDelete("DeleteCPTP")]
        public IActionResult DeleteCPTP(string code)
        {
            var quans = bD_CPTPRepository.DeleteCPTP(code);
            return Ok(quans);
        }
    }
}
